﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GestorDeFlotasDesktop
{
    public partial class Menu : Form
    {
        Form ventanaPadre;
        string[] Funcionalidad;
        Base cBase;

        public Menu(Base mibase, Form ventana, string[] Funcionalidades)
        {
            InitializeComponent();
            Funcionalidad = Funcionalidades;
            ventanaPadre = ventana;
            cBase = mibase;

            this.inicioToolStripMenuItem.DropDownItems.Remove(this.autosToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.autosToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.choferToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.clientesToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.relojToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.rolToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.turnoToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.usuariosToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.asignacionChoferViajeToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.facturacionAClientesToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.registroDeViajesToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.rendicionChoferesToolStripMenuItem);
            this.inicioToolStripMenuItem.DropDownItems.Remove(this.estadisticasToolStripMenuItem);

            int i;
            for (i = 0; i < Funcionalidad.Length; i++)
            {
                switch (Funcionalidad[i])
                {
                    case "ABM de Auto":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.autosToolStripMenuItem);
                        break;
                    case "ABM de Chofer":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.choferToolStripMenuItem);
                        break;
                    case "ABM de Cliente":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.clientesToolStripMenuItem);
                        break;
                    case "ABM de Reloj":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.relojToolStripMenuItem);
                        break;
                    case "ABM de Rol":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.rolToolStripMenuItem);
                        break;
                    case "ABM de Turno":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.turnoToolStripMenuItem);
                        break;
                    case "ABM de Usuario":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.usuariosToolStripMenuItem);
                        break;
                    case "Asignacion Chofer-Viaje":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.asignacionChoferViajeToolStripMenuItem);
                        break;
                    case "Facturacion a Cliente":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.facturacionAClientesToolStripMenuItem);
                        break;
                    case "Listado Estadistico":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.estadisticasToolStripMenuItem);
                        break;
                    case "Registro de Viajes":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.registroDeViajesToolStripMenuItem);
                        break;
                    case "Rendicion de Cuenta del Chofer":
                        this.inicioToolStripMenuItem.DropDownItems.Add(this.rendicionChoferesToolStripMenuItem);
                        break;
                    default:
                        break;
                }

            }


            
        }

        private void Menu_Load(object sender, EventArgs e)
        {

        }

        private void altaAutoItem_Click(object sender, EventArgs e)
        {
            new GestorDeFlotasDesktop.AbmAuto.AbmAuto(this).Show();
            this.Visible = false;
        }

        private void bajaAutoItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionAutoItem_Click(object sender, EventArgs e)
        {

        }

        private void altaChoferItem_Click(object sender, EventArgs e)
        {

        }

        private void bajaChoferItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionChoferItem_Click(object sender, EventArgs e)
        {

        }

        private void altaClienteItem_Click(object sender, EventArgs e)
        {

        }

        private void bajaClienteItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionClienteItem_Click(object sender, EventArgs e)
        {

        }

        private void altaRelojItem_Click(object sender, EventArgs e)
        {

        }

        private void bajaRelojItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionRelojItem_Click(object sender, EventArgs e)
        {

        }

        private void altaRolItem_Click(object sender, EventArgs e)
        {
            new GestorDeFlotasDesktop.AbmRol.ROLAlta(cBase,this).Show();
            this.Visible = false;
        }

        private void bajaRolItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionRolItem_Click(object sender, EventArgs e)
        {
            new GestorDeFlotasDesktop.AbmRol.ROLModificacion(cBase, this).Show();
            this.Visible = false;
        }

        private void altaTurnoItem_Click(object sender, EventArgs e)
        {

        }

        private void bajaTurnoItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionTurnoItem_Click(object sender, EventArgs e)
        {

        }

        private void altaUsuarioItem_Click(object sender, EventArgs e)
        {

        }

        private void bajaUsuarioItem_Click(object sender, EventArgs e)
        {

        }

        private void modificacionUsuarioItem_Click(object sender, EventArgs e)
        {

        }

        private void asignacionChoferViajeToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void facturacionAClientesToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void registroDeViajesToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void rendicionChoferesToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void estadisticasToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void Menu_FormClosing(object sender, FormClosingEventArgs e)
        {
            MessageBox.Show("Usted esta saliendo de la aplicacion");
            Application.Exit();
        }


    }
}
